import request from '@/config/axios'

// 人员管理->应急队伍 VO
export interface TeamVO {
  id: number // ID
  teamName: string // 队伍名称
  teamType: string // 队伍类型 (如:消防,医疗,通讯)
  leaderId: number // 队长ID
  specialty: string // 队伍专长描述
  remark: string // 备注
}

// 人员管理->应急队伍 API
export const TeamApi = {
  // 查询人员管理->应急队伍分页
  getTeamPage: async (params: any) => {
    return await request.get({ url: `/wms/team/page`, params })
  },
  getTeamList: async () => {
    return await request.get({ url: `/wms/team/simple_list` })
  },

  // 查询人员管理->应急队伍详情
  getTeam: async (id: number) => {
    return await request.get({ url: `/wms/team/get?id=${id}` })
  },

  // 新增人员管理->应急队伍
  createTeam: async (data: TeamVO) => {
    return await request.post({ url: `/wms/team/create`, data })
  },

  // 修改人员管理->应急队伍
  updateTeam: async (data: TeamVO) => {
    return await request.put({ url: `/wms/team/update`, data })
  },

  // 删除人员管理->应急队伍
  deleteTeam: async (id: number) => {
    return await request.delete({ url: `/wms/team/delete?id=${id}` })
  },

  // 导出人员管理->应急队伍 Excel
  exportTeam: async (params) => {
    return await request.download({ url: `/wms/team/export-excel`, params })
  },
}
